import { createBrowserRouter } from "react-router-dom";
import Home from "../pages/Home/Home";
import Shu from "../pages/Shu/Shu";
import Quan from "../pages/Quan/Quan";
import Chang from "../pages/Chang/Chang";
import Article from "../pages/Article/Article";
import Forms from "../pages/Forms/Forms";
import Detail from "../pages/Detail/Detail";
import Guan from "../pages/Guan/Guan";
import Edit from "../pages/Edit/Edit";
import Drag from "../pages/Drag/Drag";
import ProList from "../pages/ProList/ProList";
import Login from "../pages/Login/Login";
import Layouts from "../Layouts/Layouts.jsx";

export const routerlist=[
    {
        path:'/home',
        element:<Home />,
        meta:{title:'首页'}
    },
    {
        path:'/shu',
        element:<Shu />,
        meta:{title:'数据大屏'}
    },
    {
        path:'/quan',
        element:<Quan />,
        meta:{title:'权限管理'}
    },
    {
        path:'/chang',
        element:<Chang />,
        meta:{title:'常用组件'}
    },
    {
        path:'/article',
        meta:{title:'列表页面'},
        children:[
            {
                path:'/article/li',
                element:<Article />,
                meta:{title:'使用ProTable'}
            },
            {
                path:'/article/edit',
                element:<Edit />,
                meta:{title:'使用EditTable'}
            },
            {
                path:'/article/drag',
                element:<Drag />,
                meta:{title:'使用DragTable'}
            },
            {
                path:'/article/prolist',
                element:<ProList />,
                meta:{title:'使用ProList'}
            },
        ]
    },
    {
        path:'/forms',
        element:<Forms />,
        meta:{title:'表单页面'}
    },
    {
        path:'/detail',
        element:<Detail />,
        meta:{title:'详情页面'}
    },
    {
        path:'/guan',
        element:<Guan />,
        meta:{title:'关于项目'}
    },
    
]

const router=createBrowserRouter([
    {
        path:'/',
        element:<Layouts />,
        children:routerlist
    },
    {
        path:'/login',
        element:<Login />
    }
    
])

export default router;